﻿<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
			
			
%>
<!doctype html>
<html>
<head>
<meta name="format-detection" content="telephone=no" />
<meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width, height=device-height" />
<meta charset="utf-8">
<title>手机号码注册</title>
</head>
<script  src="<%=path%>/statics/js/jquery-1.8.3.js" type="text/javascript"></script>
<link href="<%=path%>/statics/resource/css/common.css" rel="stylesheet" type="text/css">
 <link rel="stylesheet" type="text/css" href="<%=path %>/statics/css/wdgz.css">
     <link rel="stylesheet" href="<%=path %>/statics/css/sysz.css">
<script type="text/javascript" src="<%=path%>/statics/resource/js/jquery.js"></script>
<script type="text/javascript" src="<%=path%>/statics/resource/js/jquery.validate.js"></script>
<script type="text/javascript" src="<%=path%>/statics/resource/js/interaction.js"></script>
<script type="text/javascript" src="<%=path %>/statics/js/alertPopShow.js"></script>

<script type="text/javascript">

</script>
<body style="background-color:#f4f4f4;">
    <div class="headBar">
        <a href="javascript:history.back(-1)"><img class="headleft" src="<%=path%>/statics/resource/images/backjt.png"></a>
        <span>手机注册</span>
    </div>
    <div class="mth1">
    </div>
    <div class="register">
    <form id="registerForm1" method="post" action="<%=path %>/user/phone.html">
    <div class="mid mt10" style="width:80%;">
      <span class="registerinputlabel">+86</span><span><img id="registericon1" class="registerinputicon" src="<%=path%>/statics/resource/images/registericon1.png"></span>
      <input type="tel" id="registermobile" name="registermobile" style="width:80%;" maxlength="11" value="输入手机号码" />
      <br/><label class="tip">为了安全，我们会向你的手机发送验证码</label>
    </div>
    <div class="mid mt10" style="width:80%;">
      <span class="registerinputlabel">密码 :</span><span><img id="registericon2" class="registerinputicon" style="width:24px;" src="<%=path%>/statics/resource/images/registericon2.png"></span>
      <input type="password" id="registerkeyword" name="registerkeyword" style="width:80%;">
      <label class="keywordtip">设置登入密码</label>
      <br/><label class="error" for="registerkeyword"></label>
    </div>
    <div class="mid mt10" style="width:80%;">
      <span class="registerinputlabel">密码 :</span><span><img id="registericon3" class="registerinputicon" style="width:24px;" src="<%=path%>/statics/resource/images/registericon2.png"></span>
      <input type="password" class="registerkeywordsa" id="registerkeyword" name="registerkeywords" style="width:80%;"  value="">
     <label class="tip">为了安全，再次输入登录密码</label>
      <br/><label class="error" for="registerkeyword"></label>
    </div>
    
    <div class="mid mt10" style="width:80%;">
      <input onclick="dels()"  type="button" style="color:#fff;font-size:16px; background:#2d94fb;border:none;border-radius:2px; width:100%;" value="下一步" />
    </div>
    </form>
    <script type="text/javascript">
    function dels() {
    var registerkeywords = $(".registerkeywordsa").val();
	 var phoneReg=/^1[13578]\d{9}$/;
            var pwdReg = /^[a-zA-Z]\w{5,17}$/;
		 var loginPhone = $("#registermobile").val().length;
             var loginPwd = $("#registerkeyword").val().length;
             if(loginPhone===0){
                 webToast("输入的手机号码不正确","middle",1000);
                 return;
             } else if(!phoneReg.test($("#registermobile").val())){
                     
            webToast("输入的手机号码不正确","middle",1000);
                     return ;
             } else if(loginPhone!==0&&loginPwd===0){
                 
                   webToast("请输入密码","middle",1000);
                 reutrn;
             } else if(!pwdReg.test($("#registerkeyword").val())){
               
                 webToast("密码格式不正确","middle",1000);
                 return;
             }else if(registerkeywords==""||registerkeywords==undefined){
         
              webToast("请输入第2次密码","middle",1000);
                 return;
             }
            
             else if(registerkeywords!=$("#registerkeyword").val()){
              webToast("两次密码输入不一致","middle",1000);
                 return;
             }
             $.ajax({
				type:"post",
				url:"<%=path%>/user/getphone.json",

				data:{phone:$("#registermobile").val()},

				dataType:"json",
				success:function(data){
				if(data.res=="true"){
				        webToast("该手机号已被注册","middle",1000);
				return;
				}
			
				  $("#registerForm1").submit(); 
					
				},
				error:function(data){
alert(1);
return;
					
				}
			});
			
              
        
          
	}
      
    </script>
    <div class="mid agreement">
        <img class="yesbtn" src="<%=path%>/statics/resource/images/yesBtn.png">
        <span>点击"下一步",即表示本人已同意<a href="#">《注册协议》</a></span>
    </div>
    </div>
<div class="x-qtip" style="display: none;"><div class="x-qtip-body"><div class="x-qtip-icon"><i></i></div><div class="x-qtip-msg">请输入手机号码</div></div></div>
</body>
</html>

